package com.lmt.ymcc.web.controller;

import com.lmt.ymcc.dto.AlipayNotifyDto;
import com.lmt.ymcc.service.IPayNotifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/pay")
public class PayNotifyController {

    @Autowired
    private IPayNotifyService payNotifyService;
    //支付宝支付回调
    @PostMapping("/alipay/notify")
    public String notify(AlipayNotifyDto dto){
        try {
            return payNotifyService.notify(dto);
        } catch (Exception e) {
            e.printStackTrace();
            return "ERROR";
        }
    }
}